package com.wang.service;

import com.wang.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wang.dao.UserDao;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService{
    @Autowired
    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public User login(String uname, String upassword) {
        return userDao.findUser(uname,upassword);
    }

    @Override
    public void addUser(User user) {
        userDao.addUser(user);

    }

    @Override
    public User selectUserbyName(String uname) {
        return userDao.selectUserbyName(uname);
    }

    @Override
    public void addParent(int uid, String uname) {
        userDao.addParent(uid,uname);
    }

    @Override
    public void addTeacher(int uid, String uname) {
        userDao.addTeacher(uid,uname);
    }

    @Override
    public void addParentMessage(Parents parents) {
        userDao.addParentMessage(parents);
    }

    @Override
    public Parents findParent(int uid) {
        return userDao.findParent(uid);
    }

    @Override
    public List<Students> findStudents(int pid) {
        return userDao.findStudents(pid);
    }

    @Override
    public void deleteStudent(int sid) {
        userDao.deleteStudent(sid);
    }

    @Override
    public Students findStudentsbysid(int sid) {
        return userDao.findStudentsbysid(sid);
    }

    @Override
    public void addStudent(Students students) {
        userDao.addStudent(students);
    }

    @Override
    public void addStudentall(Students students) {
        userDao.addStudentall(students);
    }

    @Override
    public Teacher findTeacher(int uid) {
        return userDao.findTeacher(uid);
    }

    @Override
    public void addTeacherMessage(Teacher teacher) {
        userDao.addTeacherMessage(teacher);
    }

    @Override
    public List<Lessionstime> findLessiontime(int tid) {
        return userDao.findLessiontime(tid);
    }

    @Override
    public List<Grade> findGrade(int tid) {
        return userDao.findGrade(tid);
    }

    @Override
    public List<Project> findProject(int tid) {
        return userDao.findProject(tid);
    }

    @Override
    public Lessionstime findLessiontimeByid(Integer tid) {
        return userDao.findLessiontimeByid(tid);
    }

    @Override
    public Grade findGradeByid(Integer gid) {
        return userDao.findGradeByid(gid);
    }

    @Override
    public Project findProjectByid(Integer pid) {
        return userDao.findProjectByid(pid);
    }

    @Override
    public void updatetime(Lessionstime lessionstime) {
        userDao.updatetime(lessionstime);
    }

    @Override
    public void updategrade(Grade grade) {
        userDao.updategrade(grade);
    }

    @Override
    public void updateproject(Project project) {
        userDao.updateproject(project);
    }

    @Override
    public void deletetime(Integer lid) {
        userDao.deletetime(lid);
    }

    @Override
    public void deletegrade(Integer gid) {
        userDao.deletegrade(gid);
    }

    @Override
    public void deleteproject(Integer pid) {
        userDao.deleteproject(pid);
    }

    @Override
    public void addtime(Lessionstime lessionstime) {
        userDao.addtime(lessionstime);
    }

    @Override
    public void addgrade(Grade grade) {
        userDao.addgrade(grade);
    }

    @Override
    public void addproject(Project project) {
        userDao.addproject(project);
    }

    @Override
    public List<Teacher> findTeacherall() {
        return userDao.findTeacherall();
    }

    @Override
    public Lessionstime findLessiontimeOne(int tid) {
        return userDao.findLessiontimeOne(tid);
    }

    @Override
    public Grade findGradeOne(int tid) {
        return userDao.findGradeOne(tid);
    }

    @Override
    public Project findProjectOne(int tid) {
        return userDao.findProjectOne(tid);
    }

    @Override
    public int findStudentsbyname(int pid, String sname) {
        return userDao.findStudentsbyname(pid,sname);
    }

    @Override
    public void addorder(Order order) {
        userDao.addorder(order);
    }

    @Override
    public List<Order> findOrderbytid(int tid) {
        return userDao.findOrderbytid(tid);
    }

    @Override
    public void updatetorder(Integer oid) {
        userDao.updatetorder(oid);
    }

    @Override
    public void updatetnoorder(Integer oid) {
        userDao.updatetnoorder(oid);
    }

    @Override
    public List<Order> findOrderbypid(int pid) {
        return userDao.findOrderbypid(pid);
    }

    @Override
    public void updateporder(Integer oid) {
        userDao.updateporder(oid);
    }

    @Override
    public void updatepnoorder(Integer oid) {
        userDao.updatepnoorder(oid);
    }


}
